<template>
  <div>
    <h2>我的回帖</h2>
    <ul>
      <li v-for="reply in replies" :key="reply.id">
        <p>{{ reply.content }}</p>
      </li>
    </ul>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import axios from 'axios';

const replies = ref([]);

const fetchMyReplies = async () => {
  try {
    const response = await axios.get('/api/replies/user/1'); // 假设用户 ID 为 1
    replies.value = response.data;
  } catch (error) {
    console.error(error);
  }
};

onMounted(fetchMyReplies);
</script>